/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simhya.model.store.faststore;

import simhya.model.store.Function;
import java.util.ArrayList;
import simhya.matheval.SymbolArray;

/**
 *
 * @author Luca
 */
public class ConstantFunction implements Function {
    private double value;

    public ConstantFunction(double value) {
        this.value = value;
    }

    public double compute() {
        return value;
    }

    public double compute(SymbolArray vars) {
        return value;
    }

     public double computeCache() {
        return value;
    }

    public double computeCache(SymbolArray vars) {
        return value;
    }
    
    public ArrayList<Integer> getVariableList() {
        return new ArrayList<Integer>();
    }

    public void initialize() {  }

    public String toModelLanguage() {
        return "#con(" + value + ")";
    }

    public double getConstantIncrement() {
        throw new UnsupportedOperationException("This function is not a constant increment function,"
                + "please call isConstantIncrementFunction() before this function");
    }

    public boolean isConstantIncrementFunction() {
        return false;
    }

  
}
